{% extends 'VentureAlternateRawMaterialBundle::layout.html.twig' %}

{% block title %}Alternate Raw Materials Listing{% endblock%}



{% block main %}
    {{ parent() }}
    <div class="cont"> 
        <h2 class="heading">ALTERNATE RAW MATERIALS</h2>
        <button class="add-new" onclick="window.location='{{ path('venture_new_alternate_raw_material') }}'">Add new</button>
        
        <div class="listing-label">
            <p class="label">List all active Alternate Raw Materials</p>
            {% if status %} 
            <p class="list-all">
                <input type = "checkbox" onchange="window.location='{{ path('venture_list_alternate_raw_material',  {'type': 'show_all'}) }}'"/> Show Inactive
            </p>
            {% else %}
            <p class="list-all">
                <input type = "checkbox" checked = "checked" onchange="window.location='{{ path('venture_list_alternate_raw_material',  {'type': 'show_active'}) }}'"/> Show Inactive
            </p>
            {% endif %}            
        </div>
        
        <div class="clear"></div>
         
        <table class="raw-materials-listing">
            <thead>
                <tr>
                    <th width="15%">Item#</th>
                    <th width="25%">Description</th>
                    <th width="20%">Amount In Stock</th>
                    <th width="40%">Amount on purchase order</th>
                </tr>
            </thead>
            <tbody>
                {% for alternateRawMaterial in alternateRawMaterials %}
                <tr class="records {{ cycle(['odd', 'even'], loop.index0) }}">
                    <td><a href="{{ path('venture_show_alternate_raw_material',  {'id': alternateRawMaterial.id}) }}">{{ alternateRawMaterial.ItemName }}</a></td>
                    <td><a href="{{ path('venture_show_alternate_raw_material',  {'id': alternateRawMaterial.id}) }}">{{ alternateRawMaterial.ItemDescription }}</a></td>
                    <td><a href="{{ path('venture_show_alternate_raw_material',  {'id': alternateRawMaterial.id}) }}">0</a></td>
                    <td><a href="{{ path('venture_show_alternate_raw_material',  {'id': alternateRawMaterial.id}) }}">0</a></td>
                </tr>
                {% else %}
                <tr class="empty">
                    <td colspan="5">There is no Alternate Raw material listed yet</td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
   </div>
	
{% endblock %}  